import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import local_get from '@dfeidao/atom-web/local/get';
import nodejs from '@dfeidao/atom-web/msg/nodejs';
import error from '@dfeidao/atom-web/msgbox/error';
import success from '@dfeidao/atom-web/msgbox/success';
// import whoami from '@dfeidao/atom-web/msg/whoami';
import storage_get from '@dfeidao/atom-web/storage/get';
import a001 from './a001';
// 接收选择控制点返回的选中数据并添加至至控制点表中
export default async function a010(fd: IFeidaoAiBrowserComponent, args: { data: [] }) {
	const formid = local_get(fd, "formid");
	// const user = await whoami();
	const prid = storage_get('productid');
	const res = await nodejs('function-definition/zj-000002/s003', { pub_form_code: args.data, formid, productid: prid });
	if (res === "fail") {
		error("添加失败");
	}
	if (res === "success") {
		success("添加成功");
		await a001(fd);
	}
}
